//
//  RestrictedTextField.swift
//  Yip
//
//  Created by bo wang on 2022/5/20.
//  Copyright © 2022 yip.com. All rights reserved.
//

import UIKit

/// 禁止了 UITextField 的长按操作
class RestrictedTextField: UITextField {
    
    /// 是否禁用长按菜单。默认为true。可以设置为false解除禁用。
    @IBInspectable var isMenuRestricted: Bool = true
    
    override func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool {
        return !isMenuRestricted
    }
}
